import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InsQuoteVO, InsQuoteForm, InsQuoteQuery } from '@/api/bzIns/insQuote/types';

/**
 * 查询保险报价列表
 * @param query
 * @returns {*}
 */

export const listInsQuote = (query?: InsQuoteQuery): AxiosPromise<InsQuoteVO[]> => {
  return request({
    url: '/bzIns/insQuote/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询保险报价详细
 * @param quoteId
 */
export const getInsQuote = (quoteId: string | number): AxiosPromise<InsQuoteVO> => {
  return request({
    url: '/bzIns/insQuote/' + quoteId,
    method: 'get'
  });
};

/**
 * 新增保险报价
 * @param data
 */
export const addInsQuote = (data: InsQuoteForm) => {
  return request({
    url: '/bzIns/insQuote',
    method: 'post',
    data: data
  });
};

/**
 * 修改保险报价
 * @param data
 */
export const updateInsQuote = (data: InsQuoteForm) => {
  return request({
    url: '/bzIns/insQuote',
    method: 'put',
    data: data
  });
};

/**
 * 删除保险报价
 * @param quoteId
 */
export const delInsQuote = (quoteId: string | number | Array<string | number>) => {
  return request({
    url: '/bzIns/insQuote/' + quoteId,
    method: 'delete'
  });
};
